package com.cloud.distribute.lock.annotation;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * @author zhaoyangfu - 2020/7/22 16:17
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface CacheLock {

    /** key的前缀 */
    String prefix() default "";

    /** 过期时间,默认5秒 */
    int expire() default 5;

    TimeUnit unit() default TimeUnit.SECONDS;

    /** key的分隔符 */
    String delimiter() default ":";
}
